package com.qlyl.modules.information.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.qlyl.common.aspect.annotation.Dict;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


/**
 * <p>
 * app用户表
 * </p>
 *
 * @Author liuyu
 * @since 2019-12-28
 */

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("app_user")
public class AppUser implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(type = IdType.ID_WORKER_STR)
    private String id;

    /**
     * 用户名
     */
    @Excel(name = "用户名", width = 15)
    private String username;

    /**
     * 密码
     */
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String password;

    /**
     * md5密码盐
     */
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String salt;

    /**
     * 绑定企业id
     */
    @TableField(value = "consumers_id")
    @Excel(name = "企业id", width = 15)
    private String consumersId;

    /**
     * 电话
     */
    @Excel(name = "手机号", width = 15)
    private String cphone;

    /**
     * 邮箱
     */
    @Excel(name = "邮箱", width = 15)
    private String email;

    /**
     * 图像
     */
    @TableField(value = "head_img")
    private String headImg;


    /**
     * 区块链钱包id
     */
    @TableField(value = "wallet_id")
    @Excel(name = "钱包id", width = 15)
    private String walletId;

    /**
     * 企业账户余额
     */
    @TableField(value = "account_balance")
    @Excel(name = "账户余额", width = 15)
    private BigDecimal accountBalance;

    /**
     * 认领状态
     */
    @Excel(name = "认领状态", width = 15,dicCode = "binding_status")
    @Dict(dicCode = "binding_status")
    private Integer bindingStatus;

    /**
     * 企业名称
     */
    @Excel(name = "企业名称", width = 15)
    @TableField(value = "company_name",exist = false)
    private String companyName="";

    /**
     * 删除状态（0，正常，1已删除）
     */
    @TableLogic
    private Integer delFlag;

    /**
     * 用户状态(1：正常  2：冻结 ）
     */
    @Excel(name = "用户状态", width = 15, dicCode = "user_status")
    @Dict(dicCode = "user_status")
    private Integer userStatus;

    /**
     * 注册时间
     */
    @TableField(value = "create_time")
    @Excel(name = "注册时间", width = 15,format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;



}
